Integrand size = 21, antiderivative size = 227 \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {x}{a^2}-\frac {2 b^5 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 (a-b)^{5/2} (a+b)^{5/2} d}-\frac {4 b^3 \left (2 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 (a-b)^{5/2} (a+b)^{5/2} d}-\frac {\sin (c+d x)}{2 (a+b)^2 d (1-\cos (c+d x))}+\frac {\sin (c+d x)}{2 (a-b)^2 d (1+\cos (c+d x))}+\frac {b^4 \sin (c+d x)}{a \left (a^2-b^2\right )^2 d (b+a \cos (c+d x))} \]
-x/a^2-2*b^5*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/a^2/(a-b) ^(5/2)/(a+b)^(5/2)/d-4*b^3*(2*a^2-b^2)*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2 *c)/(a+b)^(1/2))/a^2/(a-b)^(5/2)/(a+b)^(5/2)/d-1/2*sin(d*x+c)/(a+b)^2/d/(1 -cos(d*x+c))+1/2*sin(d*x+c)/(a-b)^2/d/(1+cos(d*x+c))+b^4*sin(d*x+c)/a/(a^2 -b^2)^2/d/(b+a*cos(d*x+c))
Time = 1.62 (sec) , antiderivative size = 209, normalized size of antiderivative = 0.92 \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\frac {(b+a \cos (c+d x)) \sec ^2(c+d x) \left (-\frac {2 (c+d x) (b+a \cos (c+d x))}{a^2}-\frac {4 b^3 \left (-4 a^2+b^2\right ) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right ) (b+a \cos (c+d x))}{a^2 \left (a^2-b^2\right )^{5/2}}-\frac {(b+a \cos (c+d x)) \cot \left (\frac {1}{2} (c+d x)\right )}{(a+b)^2}+\frac {2 b^4 \sin (c+d x)}{a (a-b)^2 (a+b)^2}+\frac {(b+a \cos (c+d x)) \tan \left (\frac {1}{2} (c+d x)\right )}{(a-b)^2}\right )}{2 d (a+b \sec (c+d x))^2} \]
((b + a*Cos[c + d*x])*Sec[c + d*x]^2*((-2*(c + d*x)*(b + a*Cos[c + d*x]))/ a^2 - (4*b^3*(-4*a^2 + b^2)*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]]*(b + a*Cos[c + d*x]))/(a^2*(a^2 - b^2)^(5/2)) - ((b + a*Cos[c + d*x ])*Cot[(c + d*x)/2])/(a + b)^2 + (2*b^4*Sin[c + d*x])/(a*(a - b)^2*(a + b) ^2) + ((b + a*Cos[c + d*x])*Tan[(c + d*x)/2])/(a - b)^2))/(2*d*(a + b*Sec[ c + d*x])^2)
Time = 0.71 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4386, 3042, 3376, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\cot \left (c+d x+\frac {\pi }{2}\right )^2 \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 4386 |
\(\displaystyle \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{(a \cos (c+d x)+b)^2}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (c+d x-\frac {\pi }{2}\right )^4}{\cos \left (c+d x-\frac {\pi }{2}\right )^2 \left (b-a \sin \left (c+d x-\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 3376 |
\(\displaystyle \int \left (\frac {b^4}{a^2 \left (a^2-b^2\right ) (-a \cos (c+d x)-b)^2}+\frac {2 \left (2 a^2 b^3-b^5\right )}{a^2 \left (a^2-b^2\right )^2 (-a \cos (c+d x)-b)}-\frac {1}{a^2}-\frac {1}{2 (a-b)^2 (-\cos (c+d x)-1)}+\frac {1}{2 (a+b)^2 (1-\cos (c+d x))}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {2 b^5 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d (a-b)^{5/2} (a+b)^{5/2}}-\frac {4 b^3 \left (2 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d (a-b)^{5/2} (a+b)^{5/2}}+\frac {b^4 \sin (c+d x)}{a d \left (a^2-b^2\right )^2 (a \cos (c+d x)+b)}-\frac {x}{a^2}-\frac {\sin (c+d x)}{2 d (a+b)^2 (1-\cos (c+d x))}+\frac {\sin (c+d x)}{2 d (a-b)^2 (\cos (c+d x)+1)}\) |
-(x/a^2) - (2*b^5*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(a^ 2*(a - b)^(5/2)*(a + b)^(5/2)*d) - (4*b^3*(2*a^2 - b^2)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(a^2*(a - b)^(5/2)*(a + b)^(5/2)*d) - S in[c + d*x]/(2*(a + b)^2*d*(1 - Cos[c + d*x])) + Sin[c + d*x]/(2*(a - b)^2 *d*(1 + Cos[c + d*x])) + (b^4*Sin[c + d*x])/(a*(a^2 - b^2)^2*d*(b + a*Cos[ c + d*x]))
3.4.10.3.1 Defintions of rubi rules used
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[ExpandTrig[(d*sin[ e + f*x])^n*(a + b*sin[e + f*x])^m*(1 - sin[e + f*x]^2)^(p/2), x], x] /; Fr eeQ[{a, b, d, e, f}, x] && NeQ[a^2 - b^2, 0] && IntegersQ[m, 2*n, p/2] && ( LtQ[m, -1] || (EqQ[m, -1] && GtQ[p, 0]))
Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n _), x_Symbol] :> Int[Cos[c + d*x]^m*((b + a*Sin[c + d*x])^n/Sin[c + d*x]^(m + n)), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && IntegerQ[n] && IntegerQ[m] && (IntegerQ[m/2] || LeQ[m, 1])
Time = 1.44 (sec) , antiderivative size = 184, normalized size of antiderivative = 0.81
method | result | size |
derivativedivides | \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a^{2}-4 a b +2 b^{2}}-\frac {1}{2 \left (a +b \right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {2 b^{3} \left (-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b}-\frac {\left (4 a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2} a^{2}}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}}{d}\) | \(184\) |
default | \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a^{2}-4 a b +2 b^{2}}-\frac {1}{2 \left (a +b \right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {2 b^{3} \left (-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b}-\frac {\left (4 a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2} a^{2}}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}}{d}\) | \(184\) |
risch | \(-\frac {x}{a^{2}}-\frac {2 i \left (-2 a^{4} b \,{\mathrm e}^{3 i \left (d x +c \right )}-b^{5} {\mathrm e}^{3 i \left (d x +c \right )}+a^{5} {\mathrm e}^{2 i \left (d x +c \right )}-3 a^{3} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-a \,b^{4} {\mathrm e}^{2 i \left (d x +c \right )}+2 a^{2} b^{3} {\mathrm e}^{i \left (d x +c \right )}+b^{5} {\mathrm e}^{i \left (d x +c \right )}+a^{5}+a^{3} b^{2}+a \,b^{4}\right )}{\left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right ) \left (a^{2}-b^{2}\right )^{2} a^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) d}-\frac {4 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}+\frac {b^{5} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d \,a^{2}}+\frac {4 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}-\frac {b^{5} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d \,a^{2}}\) | \(529\) |
1/d*(1/2*tan(1/2*d*x+1/2*c)/(a^2-2*a*b+b^2)-1/2/(a+b)^2/tan(1/2*d*x+1/2*c) +2*b^3/(a-b)^2/(a+b)^2/a^2*(-a*b*tan(1/2*d*x+1/2*c)/(tan(1/2*d*x+1/2*c)^2* a-tan(1/2*d*x+1/2*c)^2*b-a-b)-(4*a^2-b^2)/((a-b)*(a+b))^(1/2)*arctanh((a-b )*tan(1/2*d*x+1/2*c)/((a-b)*(a+b))^(1/2)))-2/a^2*arctan(tan(1/2*d*x+1/2*c) ))
Time = 0.32 (sec) , antiderivative size = 705, normalized size of antiderivative = 3.11 \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\left [\frac {4 \, a^{5} b^{2} - 2 \, a^{3} b^{4} - 2 \, a b^{6} - {\left (4 \, a^{2} b^{4} - b^{6} + {\left (4 \, a^{3} b^{3} - a b^{5}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) \sin \left (d x + c\right ) - 2 \, {\left (a^{7} - a b^{6}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{6} b - 2 \, a^{4} b^{3} + a^{2} b^{5}\right )} \cos \left (d x + c\right ) - 2 \, {\left ({\left (a^{7} - 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} - a b^{6}\right )} d x \cos \left (d x + c\right ) + {\left (a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}\right )} d x\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{9} - 3 \, a^{7} b^{2} + 3 \, a^{5} b^{4} - a^{3} b^{6}\right )} d \cos \left (d x + c\right ) + {\left (a^{8} b - 3 \, a^{6} b^{3} + 3 \, a^{4} b^{5} - a^{2} b^{7}\right )} d\right )} \sin \left (d x + c\right )}, \frac {2 \, a^{5} b^{2} - a^{3} b^{4} - a b^{6} - {\left (4 \, a^{2} b^{4} - b^{6} + {\left (4 \, a^{3} b^{3} - a b^{5}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - {\left (a^{7} - a b^{6}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{6} b - 2 \, a^{4} b^{3} + a^{2} b^{5}\right )} \cos \left (d x + c\right ) - {\left ({\left (a^{7} - 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} - a b^{6}\right )} d x \cos \left (d x + c\right ) + {\left (a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}\right )} d x\right )} \sin \left (d x + c\right )}{{\left ({\left (a^{9} - 3 \, a^{7} b^{2} + 3 \, a^{5} b^{4} - a^{3} b^{6}\right )} d \cos \left (d x + c\right ) + {\left (a^{8} b - 3 \, a^{6} b^{3} + 3 \, a^{4} b^{5} - a^{2} b^{7}\right )} d\right )} \sin \left (d x + c\right )}\right ] \]
[1/2*(4*a^5*b^2 - 2*a^3*b^4 - 2*a*b^6 - (4*a^2*b^4 - b^6 + (4*a^3*b^3 - a* b^5)*cos(d*x + c))*sqrt(a^2 - b^2)*log((2*a*b*cos(d*x + c) - (a^2 - 2*b^2) *cos(d*x + c)^2 + 2*sqrt(a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2* a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + b^2))*sin(d*x + c) - 2*(a^7 - a*b^6)*cos(d*x + c)^2 + 2*(a^6*b - 2*a^4*b^3 + a^2*b^5)*cos(d*x + c) - 2*((a^7 - 3*a^5*b^2 + 3*a^3*b^4 - a*b^6)*d*x*cos(d*x + c) + (a^6*b - 3*a^4*b^3 + 3*a^2*b^5 - b^7)*d*x)*sin(d*x + c))/(((a^9 - 3*a^7*b^2 + 3*a ^5*b^4 - a^3*b^6)*d*cos(d*x + c) + (a^8*b - 3*a^6*b^3 + 3*a^4*b^5 - a^2*b^ 7)*d)*sin(d*x + c)), (2*a^5*b^2 - a^3*b^4 - a*b^6 - (4*a^2*b^4 - b^6 + (4* a^3*b^3 - a*b^5)*cos(d*x + c))*sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2 + b^2)*( b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x + c)))*sin(d*x + c) - (a^7 - a*b^ 6)*cos(d*x + c)^2 + (a^6*b - 2*a^4*b^3 + a^2*b^5)*cos(d*x + c) - ((a^7 - 3 *a^5*b^2 + 3*a^3*b^4 - a*b^6)*d*x*cos(d*x + c) + (a^6*b - 3*a^4*b^3 + 3*a^ 2*b^5 - b^7)*d*x)*sin(d*x + c))/(((a^9 - 3*a^7*b^2 + 3*a^5*b^4 - a^3*b^6)* d*cos(d*x + c) + (a^8*b - 3*a^6*b^3 + 3*a^4*b^5 - a^2*b^7)*d)*sin(d*x + c) )]
\[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\int \frac {\cot ^{2}{\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \]
Exception generated. \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?` f or more de
Time = 0.34 (sec) , antiderivative size = 332, normalized size of antiderivative = 1.46 \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=-\frac {\frac {4 \, {\left (4 \, a^{2} b^{3} - b^{5}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{{\left (a^{6} - 2 \, a^{4} b^{2} + a^{2} b^{4}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{2} - 2 \, a b + b^{2}} + \frac {a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 4 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a^{4} + a^{3} b + a^{2} b^{2} - a b^{3}}{{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}} + \frac {2 \, {\left (d x + c\right )}}{a^{2}}}{2 \, d} \]
-1/2*(4*(4*a^2*b^3 - b^5)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(-2*a + 2*b ) + arctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(-a^2 + b^2)))/((a^6 - 2*a^4*b^2 + a^2*b^4)*sqrt(-a^2 + b^2)) - tan(1/2*d*x + 1/2* c)/(a^2 - 2*a*b + b^2) + (a^4*tan(1/2*d*x + 1/2*c)^2 - 3*a^3*b*tan(1/2*d*x + 1/2*c)^2 + 3*a^2*b^2*tan(1/2*d*x + 1/2*c)^2 - a*b^3*tan(1/2*d*x + 1/2*c )^2 + 4*b^4*tan(1/2*d*x + 1/2*c)^2 - a^4 + a^3*b + a^2*b^2 - a*b^3)/((a^5 - 2*a^3*b^2 + a*b^4)*(a*tan(1/2*d*x + 1/2*c)^3 - b*tan(1/2*d*x + 1/2*c)^3 - a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))) + 2*(d*x + c)/a^2)/d
Time = 18.96 (sec) , antiderivative size = 6093, normalized size of antiderivative = 26.84 \[ \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx=\text {Too large to display} \]
((a^2 - 2*a*b + b^2)/(a + b) - (tan(c/2 + (d*x)/2)^2*(a^4 - 3*a^3*b - a*b^ 3 + 4*b^4 + 3*a^2*b^2))/(a*(a + b)^2))/(d*(tan(c/2 + (d*x)/2)^3*(6*a*b^2 - 6*a^2*b + 2*a^3 - 2*b^3) + tan(c/2 + (d*x)/2)*(2*a*b^2 + 2*a^2*b - 2*a^3 - 2*b^3))) - (2*atan(-((tan(c/2 + (d*x)/2)*(32*a^26 - 96*a^25*b - 64*a^3*b ^23 + 128*a^4*b^22 + 672*a^5*b^21 - 1376*a^6*b^20 - 3008*a^7*b^19 + 6528*a ^8*b^18 + 7072*a^9*b^17 - 17632*a^10*b^16 - 8480*a^11*b^15 + 29600*a^12*b^ 14 + 2176*a^13*b^13 - 31744*a^14*b^12 + 8224*a^15*b^11 + 21344*a^16*b^10 - 12992*a^17*b^9 - 8128*a^18*b^8 + 9568*a^19*b^7 + 992*a^20*b^6 - 4000*a^21 *b^5 + 480*a^22*b^4 + 928*a^23*b^3 - 224*a^24*b^2) - ((32*a^28 - 32*a^27*b + 32*a^6*b^22 - 416*a^8*b^20 + 224*a^9*b^19 + 2080*a^10*b^18 - 1824*a^11* b^17 - 5472*a^12*b^16 + 6528*a^13*b^15 + 8256*a^14*b^14 - 13440*a^15*b^13 - 6720*a^16*b^12 + 17472*a^17*b^11 + 1344*a^18*b^10 - 14784*a^19*b^9 + 288 0*a^20*b^8 + 8064*a^21*b^7 - 3168*a^22*b^6 - 2688*a^23*b^5 + 1504*a^24*b^4 + 480*a^25*b^3 - 352*a^26*b^2 - (tan(c/2 + (d*x)/2)*(128*a^8*b^22 - 64*a^ 7*b^23 - 64*a^29*b + 576*a^9*b^21 - 1280*a^10*b^20 - 2240*a^11*b^19 + 5760 *a^12*b^18 + 4800*a^13*b^17 - 15360*a^14*b^16 - 5760*a^15*b^15 + 26880*a^1 6*b^14 + 2688*a^17*b^13 - 32256*a^18*b^12 + 2688*a^19*b^11 + 26880*a^20*b^ 10 - 5760*a^21*b^9 - 15360*a^22*b^8 + 4800*a^23*b^7 + 5760*a^24*b^6 - 2240 *a^25*b^5 - 1280*a^26*b^4 + 576*a^27*b^3 + 128*a^28*b^2)*1i)/a^2)*1i)/a^2) /a^2 + (tan(c/2 + (d*x)/2)*(32*a^26 - 96*a^25*b - 64*a^3*b^23 + 128*a^4...